<template>
  <div>
    <div style="margin: auto; margin-top: 200px">
      <el-checkbox-group v-model="CheckList"
        ><el-checkbox-button
          v-for="(item, index) in ButtonList"
          :label="item.value"
          :key="index"
        >
          {{ item.text }}
        </el-checkbox-button>
      </el-checkbox-group>
      <br />
      <br />
      <el-button type="success" @click="RolePerButton">确认分配</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      CheckList: [],
      ButtonList: [
        { text: "查询", value: "Search" },
        { text: "新建", value: "Add" },
        { text: "删除", value: "Delete" },
        { text: "编辑", value: "Update" },
        { text: "导入", value: "Import" },
        { text: "导出", value: "Export" },
        { text: "上传", value: "Upload" },
        { text: "审核", value: "Audit" },
      ],
    };
  },
  created() {
    this.GetPerButtonValue();
  },
  methods: {
    GetPerButtonValue() {
      var arr = this.$route.query.Id.split(",");

      this.axios
        .get(
          "http://localhost:5255/api/Permission/GetPermissionById?Id=" + arr[0]
        )
        .then((res) => {
          this.CheckList = res.data.Data.ButtonJson.split(",");
        });
    },
    RolePerButton() {},
  },
};
</script>

<style>
</style>